﻿using MediatR;
using T.Personnel.API.Application.Command.ManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.API.Application.CommandHandler.EntryManageHandler
{
    public class DelEntryManageHandler : IRequestHandler<DelEntryManageCommand, int>
    {
        private readonly IManageRepository manageRepository;

        public DelEntryManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<int> Handle(DelEntryManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.DelEntryAsync(request.id, request.name);
        }
    }
}
